﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CrashSimul8or
{
    class ButtonEvent
    {
        public delegate void EventAction();

        private EventAction actionFunc;

        public ButtonEvent(EventAction actionFunc)
        {
            this.actionFunc = new EventAction(actionFunc);
        }

        public void buttonPressed()
        {
            if (GameVariables.soundEffects) ResourceManager.getSound("clickButton").Play();
            actionFunc();
        }
    }
}
